import request from '@/utils/request'

export default {
  //1.添加课程信息
  addCourseInfo(courseInfo){
    return request({
      url: '/eduService/course/addCourseInfo',
      method: 'post',
      data:courseInfo
    })
  },

  //根据课程id查询课程基本信息
  getCourseInfoId(id){
    return request({
      url:"/eduService/course/getCourseInfo/"+id,
      method: 'get',
    })
  },

  //修改课程信息
  updateCourseInfoById(courseInfo){
    return request({
      url:"/eduService/course/updateCouseInfo/",
      method: 'post',
      data: courseInfo
    })
  },
  //课程确认信息查询
  getPublishCourseInfo(id){
    return request({
      url:"/eduService/course/getPublishCourseInfo/"+id,
      method: 'get'
    })
  },
  //课程的最终发布
  publishCourse(id){
    return request({
      url:"/eduService/course/publishCourse/"+id,
      method: 'post'
    })
  },
  //分页查询课程信息
  getPageList(page, limit, courseQuery) {
    return request({
      url: `/eduService/course/pageCourse/${page}/${limit}`,
      method: 'post',
      data: courseQuery
    })
  },
  //删除课程
  delete(courseId){
    return request({
      url:"/eduService/course/delete/"+courseId,
      method: 'delete'
    })
  }
  }
